<div class="box_right">
	<h1>查询</h1>
	
	<div class="pro_box">
		<div class="layui-form-item">
		  <div class="layui-inline">
		  	<form class="layui-form" action="<?php echo base_url().'third/coupon/index'?>" method="get">
		  		<?php if(isset($city_id)):?>
					<input name="city_id" type="hidden" value="<?php echo $city_id?>">
				<?php endif?>
			    <label class="layui-form-label" style="width: 110px;">领取日期</label>
			    <div class="layui-input-inline" style="width: 200px;">
			    	<input type="text" name="date1" class="layui-input" id="test5" placeholder="年-月-日" value="<?php if (isset($date1))echo $date1;?>">
			    </div>
			    <div class="layui-form-mid">到</div>
			    <div class="layui-input-inline" style="width: 200px;">
			    	<input type="text" name="date2" class="layui-input" id="test6" placeholder="年-月-日" value="<?php if (isset($date2))echo $date2;?>">
			    </div>
                <label class="layui-form-label" style="width: 110px;">是否已使用</label>
                <div class="layui-input-inline" style="width: 200px;">
			    	<select name="status">
                    	<option value="-1" <?php if($status===-1):?> selected="selected"<?php endif;?>>全部</option>
                        <option value="0" <?php if($status===0):?> selected="selected"<?php endif;?>>未使用</option>
                        <option value="1" <?php if($status===1):?> selected="selected"<?php endif;?>>已使用</option>
                    </select>
			    </div>
			  
			  </div>
			  </div>
			  <div class="layui-form-item">
			    <div class="layui-input-block">
			      <button class="btn_tj">查询</button>
			    </div>
			  </div>
		  </form>
		  <div class="order_list">
		  	<div class="layui-row">
		  		<div class="layui-col-xs4">
		  			<h2 class="order_list_h">已领优惠券列表 (人数:<?php echo $p_count;?>)</h2>
		  		</div>
		  		<!--<div class="layui-col-xs1 layui-col-xs-offset7">
		  			<button class="btn_get">导出</button>
		  		</div>-->
		  	</div>
		  		
			<table class="layui-table ct" lay-skin="line">

			  <thead>
			    <tr >
			      <th>用户手机号</th>
			      <th>优惠券名称</th>
                  <th>领取时间</th>
                  <th>是否使用</th>
           
			    </tr> 
			  </thead>
			  <tbody>
			  	<?php if (isset($result)&&count($result)>0){
					foreach ($result as $app){
				?>
			    <tr>
			      <td><?php echo $app['login_name'];?></td>
			      <td><?php echo $app['coupon_name'];?></td>
                  <td><?php echo $app['create_time'];?></td>
				  <td><?php if(!empty($app['status'])){echo '已使用';}else{echo '未使用';}?></td>
			    </tr>
				<?php }
					}else{?>
					<tr>
						<td colspan="7">无数据</td>
					</tr>
				<?php }?>
			  </tbody>
			</table>
		  </div> 
          <div class="col-sm-12" id="page">
		<div class="modal-footer no-margin-top">
			<div class="pull-left record">
				共<?php echo $count;?>条记录
				</div>
            	<?php if (isset($page))echo $page;?>
		</div>
	  </div>
	</div>
</div>
<script>
//Demo

layui.use(['form','element','laydate'], function(){
  var form = layui.form,
  	element = layui.element,
  	laydate = layui.laydate;

  //时间选择器
  laydate.render({
    elem: '#test5',
	type:'date'
  });
    //时间选择器
  laydate.render({
    elem: '#test6',
	type:'date'
  }); 
  
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
});
</script>	